#include "Employee.h"
#include "Memento.h"
#include "Organizer.h"

Organizer::Organizer(void)
{
}

Organizer::Organizer(Employee* employee)
{
	setEmployee(employee);
}

Organizer::~Organizer(void)
{
}

void Organizer::setEmployee(Employee* employee)
{
	m_pEmployee = employee;
}

Employee* Organizer::getEmployee()
{
	return m_pEmployee;
}

Memento* Organizer::createMemento()
{
	Memento* mem = new Memento();
	mem->name = m_pEmployee->name;
	mem->age = m_pEmployee->age;
	return mem;
}

void Organizer::restoreToMemento(Memento* pMem)
{
	 m_pEmployee->name = pMem->name;
	 m_pEmployee->age = pMem->age;
}
